﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'P_GetExecutionOperationCount')
	BEGIN
		DROP  Procedure  [esf_sso].P_GetExecutionOperationCount
	END

GO

CREATE Procedure [esf_sso].P_GetExecutionOperationCount
	@pCustomOperationName	VARCHAR (500) = NULL
AS
	SELECT
		COUNT (*)
	FROM
		esf_sso.OperationExecution
	WHERE 
		@pCustomOperationName IS NULL OR CustomOperationName = @pCustomOperationName